package com.ikun.yummy.manager;
import android.content.Context;
import com.ikun.yummy.bean.UserInfo;
import com.ikun.yummy.sourceop.op.UserOP;
public class UserOpManager {
    private final UserOP userOP;
    public UserOpManager(Context context){
        userOP = new UserOP(context);
    }
    public boolean sign(UserInfo userInfo){
        return userOP.sign(userInfo);
    }
    public UserInfo login(UserInfo userInfo, String by){
        return userOP.login(userInfo,by);
    }
    //null为不更新,password和userimage可选
    public void update(UserInfo userInfo){
        userOP.updateByUsername(userInfo);
    }
    public void updateByEmail(UserInfo userInfo){
        userOP.updateByEmail(userInfo);
    }
    //通过用户名获取用户信息
    public UserInfo queryUser(String username){
      return userOP.queryUserByUsername(username);
    }
    public UserInfo queryUserByEmail(String email){
        return userOP.queryUserByEmail(email);
    }

}
